import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

import Login from '../pages/login'
import Register from '../pages/register'
import Chat from '../pages/chat'
import Main from '../pages/main'
import Home from '../pages/home'
import List from '../pages/list'
import Top from '../pages/top'
import Mine from '../pages/mine'
export const routerMap = [
    {
        path: '/login',
        component: Login
    },
    {
        path:"/main",
        component:Main,
        children:[
            {
              path:'/mine',
              component: Mine
            },
            {
                path:'/top',
                component: Top
            },
            {
                path:'/list',
                component: List
            },
            {
              path:'/home',
              component: Home
            },{
                path:'/register',
                component:Register
            },
            {
                path:'/chat',
                component:Chat
            }
        ]
    }
]

/**
 *
 * base 项目的根目录地址
 * 上传到服务器如果不在根目录下就需要配置
 */
export default new Router({
    base:process.env.VUE_APP_BASE,
    mode:'history',
    routes:routerMap
})
